package Control;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

import Model.Wereld;

public class KeyControl extends KeyAdapter{
	
	private Wereld wereld;
	public KeyControl(Wereld wereld)
	{
		this.wereld = wereld;
	}
	
		public void keyPressed(KeyEvent e) {
			if(e.getKeyCode() == KeyEvent.VK_UP)
			{
				wereld.move(0, -.1);
			}
			if(e.getKeyCode() == KeyEvent.VK_DOWN)
			{
				wereld.move(0, .1);
			}
			if(e.getKeyCode() == KeyEvent.VK_LEFT)
			{
				wereld.move(-.1, 0);
			}
			if(e.getKeyCode() == KeyEvent.VK_RIGHT)
			{
				wereld.move(.1, 0);
			}
			if(e.getKeyCode() == KeyEvent.VK_SPACE)
			{
				wereld.stopHeli();
			}
			if(e.getKeyCode() == KeyEvent.VK_ESCAPE)
			{
				System.out.println("werkt");
			}
		}
	}